package com.sijia.reggie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sijia.reggie.comment.BaseContext;
import com.sijia.reggie.comment.R;
import com.sijia.reggie.entity.ShoppingCart;
import com.sijia.reggie.mapper.ShoppingCartMapper;
import com.sijia.reggie.service.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 杨思佳
 * @version 1.0
 */
@Service
public class ShoppingCartServiceImpl
        extends ServiceImpl<ShoppingCartMapper, ShoppingCart> implements ShoppingCartService {



    @Override
    public void clean() {
        LambdaQueryWrapper<ShoppingCart> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ShoppingCart::getUserId, BaseContext.getCurrentId());
        this.remove(wrapper);
    }
}
